local Sheild = require("gameLogic.fight.fightSheild.Sheild")
local BloodBackSheild = class("Sheild", Sheild)

function BloodBackSheild:actor(id, baseId, value, element)
    BloodBackSheild.super.ctor(self, id, baseId, value, element)
end

function BloodBackSheild:setBackBloodParam(param) -- 千分比
    self._backRatio = param
end

function BloodBackSheild:remove(battleReport)
    BloodBackSheild.super.remove(self, battleReport)
    local AttributeConst = require("const.AttributeConst")
    local diff = self._initValue - self._value
    local value = math.floor(diff * (self._backRatio / 1000))
    local hurt = require("gameLogic.fight.fightHurtStrategy.Hurt").new(value, false, AttributeConst.ELEMENT_TREATMENT)
    self._entity:simpleHurt(hurt, battleReport)
    battleReport:addSubHurt(hurt, self._entity, self._entity)
end

return BloodBackSheild
